<?php $postsArray = $posts->getResults() ?>
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
  <title>ProBolnici</title>
  <description>Блог врача общей практики</description>
  <link>http://probolnici.ru/blog/</link>
  <language>ru-ru</language>
  <lastBuildDate><?php echo $postsArray[0]->getDateTimeObject('created_at')->format('D, j M Y H:i:s O') ?></lastBuildDate>
  
  <?php foreach($postsArray as $post): ?>
  <item>
          <title><?php echo $post->getHeader() ?></title>
          <?php $description = $post->getRawValue()->getDescriptionArticles() ?>
          <description><?php echo strip_tags($description['text']) ?></description>
          <link><?php echo url_for('@blog_show?category='.$post->getCategoryUrl().'&slug='.$post->getName(), true) ?></link>
          <guid>unique string per item</guid>
          <pubDate><?php echo $post->getDateTimeObject('created_at')->format('D, j M Y H:i:s O') ?></pubDate>
  </item>
  <?php endforeach; ?>
</channel>
</rss>

